Skip to content

Consolidate fare/gflight into flight search with --backend auto-detect#3

Merged
ak2k merged 1 commit into
mainfrom
worktree-work-0txq-search-consolidation
May 15, 2026
Merged

Consolidate fare/gflight into flight search with --backend auto-detect#3
ak2k merged 1 commit into
mainfrom
worktree-work-0txq-search-consolidation

Conversation

@ak2k

@ak2k ak2k commented May 15, 2026

Copy link
Copy Markdown
Owner

Summary

Collapses flight fare (Matrix) and flight gflight (Google Flights) into a single capability-first flight search command with --backend auto|matrix|gflight. Auto-detect picks Matrix when a Matrix-only flag is set (routing/extension/multi-city slice/time-of-day/extra pax types/PP config) and Google Flights otherwise — addressing the leaky-abstraction problem that the old backend-named commands had.

  • PP augmentation is now implicit on the Matrix backend when valid PointsPath tokens are loaded. Opt out with --no-pp; --pp-only hard-errors if tokens are missing.
  • fare and gflight are now @app.command(deprecated=True) aliases that print a migration hint and forward to the same _run_matrix_path / _run_gflight_path helpers search uses. Existing scripts keep working for one release. --pp on fare is a backcompat no-op (PP is implicit either way).
  • Errors clearly when --backend gflight conflicts with a Matrix-only flag — the request is inexpressible on fli, so we fail at parse time rather than deep in the bridge.
  • README "What it does" and the flight-search SKILL.md are rewritten around the new surface; fare/gflight stay documented as deprecated aliases.

Closes work-0txq. Unblocks the downstream gflight-flag-passthrough issues (work-7a4s/zyt1/xyx7/6jqs/ngge/v7gb) which now land on search, and work-z6zi (AwardProvider abstraction) which builds on the consolidated surface.

Test plan

  • make check (ruff lint + format + basedpyright strict + pytest) — all green
  • 86/86 tests pass (69 existing + 17 new in tests/test_backend_dispatch.py covering every Matrix-only trigger + explicit/auto/conflict/invalid-backend cases)
  • flight --help shows (deprecated) on fare/gflight
  • flight search --help documents --backend, --no-pp, and which flags are Matrix-only
  • flight search JFK LHR --dep 2026-08-15 --backend gflight --routing "LH+" errors at parse time with a clear conflict message
  • flight fare ... still works; emits a typer DeprecationWarning + custom migration hint to stderr
  • flight gflight ... still works; emits a typer DeprecationWarning + custom migration hint to stderr

The fare/gflight split encoded the backend in the command name — a leaky
abstraction that didn't scale (~90% overlap, --pp crosscut both, no path
to a third provider). Replace with `flight search` that auto-picks Matrix
when a Matrix-only flag is set (routing/extension/multi-city slice/time-
of-day/extra pax types/PP config) and Google Flights otherwise. PP
augmentation is now implicit on the Matrix backend when tokens load
successfully (--no-pp opts out).

fare and gflight become @app.command(deprecated=True) aliases that print a
migration hint and forward to the same _run_matrix_path / _run_gflight_path
helpers `search` uses. Scripts that pinned --pp still work; --pp on `fare`
becomes a backcompat no-op (PP runs implicitly anyway).

Tests cover every Matrix-only trigger plus the explicit/auto/conflict/
invalid-backend cases (17 new in tests/test_backend_dispatch.py). README
"What it does" and the flight-search SKILL.md are rewritten around the
new surface; fare/gflight remain documented as deprecated aliases.

Closes work-0txq. Unblocks work-7a4s/zyt1/xyx7/6jqs/ngge/v7gb (gflight-
flag passthrough issues, which now land on `search`) and work-z6zi
(AwardProvider abstraction, which builds on the consolidated surface).
@ak2k ak2k merged commit 10baffa into main May 15, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant